#pragma once
#include <renderer/sceneobject.h>
#include <renderer/camera.h>
/************************************************************************/
/* the World ,right hand coordinate system

*/
/************************************************************************/

BEGIN_NAMESPACE_OXGE



class  RENDERER_TRANSFER SceneNode : public oxgeClass<SceneNode>
{
public:	
	
	Camera* GetActiveCamera(){ return m_activeCamera.get(); }
	
	Camera* CreateCamera();
	SceneNode& SetActiveCamera(Camera* pCamera){ m_activeCamera = pCamera;return *this;  }

	SceneNode* CreateChildNode(SceneNode* pNode);
	bool RemoveChildNode(SceneNode* pNode);
	void RemoveAllNodes();

	int GetChildNodeCount()const{ return (int)m_vChildNodes.size(); }
	SceneNode* GetChild(int idx){ return m_vChildNodes[idx].get(); }

	Transformation3D& GetTransformation(){ return m_transform; }

	//scene object
	int GetSceneObjectCount()const{ return (int)m_vSceneObjects.size(); }
	SceneObject* GetSceneObject(int idx){ return m_vSceneObjects[idx].get(); }
	void AddSceneObject(SceneObject* pObj){ m_vSceneObjects.push_back(pObj); }
	void RemoveObject(SceneObject* pObj);
	void RemoveAllObjects();

protected:
	std::vector<Camera::RefPtr> m_vCameras;
	Camera::RefPtr m_activeCamera;

	std::vector<SceneObject::RefPtr> m_vSceneObjects;


	Transformation3D m_transform; // transformation with father node
	std::vector<SceneNode::RefPtr> m_vChildNodes;
	
};




END_NAMESPACE_OXGE